﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Newtonsoft.Json;

namespace Tulde.WindowsPhone.Music.ViewModel
{
    [JsonObject()]
    public class Mp3TunesCredentials : ICredentials
    {
        private string _token;
        [JsonProperty()]
        public string Token
        {
            get
            {
                return global::Tulde.WindowsPhone.Music.Strings.PartnerToken;
            }
            set
            {
                this._token = value;
            }
        }
        [JsonProperty()]
        public string UserName { get; set; }
        [JsonProperty()]
        public string Password { get; set; }
        public Mp3TunesCredentials()
        {

        }

        #region ICredentials Members

        public NetworkCredential GetCredential(Uri uri, string authType)
        {
            return new NetworkCredential
            {
                Domain = this.Token,
                UserName = this.UserName,
                Password = this.Password
            };
        }

        #endregion
    }
}
